

const { newRubickBase } = require('rubickbase')
const { clipboard } = require('electron')
const EnvContext = require('../../common/context/EnvContext');




exports.initMouseEvent = async function () {
    const rubickBase = newRubickBase()
    var robot = require("robotjs");
    const api = await rubickBase.getAPI()

    const register = api.setEventChannel({
        device: 'Mouse',
        action: 'Press',
        info: 'Right',
    })

    EnvContext.getInstance().setApi(register)


    register('myeventchannel', async (e) => {
        robot.keyTap("c", "command");
        doSearchByPanel(clipboard.readText())
    })
}



function doSearchByPanel(keyword) {

}